import request from './request'

export interface FileData {
    id: number;
    image: string;
    pdf: string;
}
/**
 * 更新文件保存路径
 * @param data 
 * @returns 
 */
export const uploadFilePath = (data: FileData)=>{
    return request({
        url: `uploadFile/update`,
        method: 'post',
        data: data
    })
}
/**
 * 根据id获取文件保存路径
 * @param id 
 * @returns 
 */
export const getFilePathById = (id: number)=>{
    return request({
        url: `uploadFile/getFilePath?id=${id}`,
        method: 'get',
    })
}

/**
 * 新增文件保存路径
 * @param data
 * @returns
 */
export const addFilePath = (data: FileData)=>{
    return request({
        url: `uploadFile/add`,
        method: 'post',
        data: data
    })
}